package com.disability_federation.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 统一封装返回结果
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {

    /**
     * 响应码
     * 1 成功 , 0 失败
     */
    private Integer code ;

    /**
     * 响应提示信息
     */
    private String msg;

    /**
     * 响应数据
     */
    private Object data;

    public static Result success(Object data){
        return new Result(1,"success",data);
    }

    public static Result fail(){
        return new Result(0,"error",null);
    }


}
